<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="org.json.*"%>
<%@ page import="com.gzgi.framework.*"%>
<%@ page import="com.gzgi.framework.el.*"%>
<%@ page import="com.gzgi.framework.util.*"%>
<%@ page import="com.gzgi.framework.config.*"%>
<%@ page import="com.gzgi.framework.context.*"%>
<%@ page import="com.gzgi.framework.tree.*"%>
<%@ page import="com.gzgi.framework.dataitem.*"%>
<%@ page import="com.gzgi.framework.sys.*"%>
<%@ page import="com.gzgi.framework.sys.model.*"%>
<%@ page import="com.gzgi.workflow.jbpm.model.*"%>
<%@ page import="com.gzgi.workflow.jbpm.container.*"%>
<%@ page import="com.gzgi.form.service.*"%>
<%@ page import="com.gzgi.form.graph.def.*"%>
<%@ page import="com.gzgi.form.graph.exe.*"%>
<%@ page import="org.apache.commons.lang.*"%>
<%
     String actorId = (String) request.getSession().getAttribute(
				SecurityContext.LOGIN_ACTOR_ID);
	 String app_name = request.getParameter("app_name");
	 FormService formService = null;
	 FormApplication formApplication = null;
	 List taskItems = null;
     try{
		 formService = (FormService) ContextFactory.getBean("formService");
		 FormContext formContext = new FormContext();
		 formApplication = formService.getFormApplicationByName(formContext, app_name);
         if(formApplication != null && StringUtils.isNotEmpty(formApplication.getProcessName())){
			 ProcessContainer container = ProcessContainer.getContainer();
			 taskItems = container.getTaskItemsByProcessName(formApplication.getProcessName(), actorId);
		 }
	 }catch(Exception ex){
		 ex.printStackTrace();
	 }
	 if(taskItems != null && taskItems.size() > 0){
		 Iterator iterator = taskItems.iterator();
		 while(iterator.hasNext()){
			 TaskItem item = (TaskItem)iterator.next();
%>
<div align="left" >
<label style="cursor: pointer;" onclick="javascript:loadDocData('<%=item.getRowId()%>');">
<img src="<%=request.getContextPath()%>/pages/images/m.gif"> 
<%=item.getTaskDescription()%> [<%=DateTools.getDate(item.getCreateDate())%>]
</label>
</div>
<%     }
	 }else{
		 out.println("暂无待办任务！");
	 }
%>